package com.cardone.platform.authority.service;

import java.util.List;

import lombok.Getter;
import lombok.Setter;

import com.cardone.common.dto.PaginationDto;
import com.cardone.context.ContextHolder;
import com.cardone.platform.authority.dao.UsGrBusinessAreaDao;
import com.cardone.platform.authority.dto.UsGrBusinessAreaDto;

/**
 * 用户组与业务范围服务
 *
 * @author yaohaitao
 *
 */
@Getter
@Setter
public class UsGrBusinessAreaDefaultService implements UsGrBusinessAreaService {
	@Override
	public int deleteByIds(final UsGrBusinessAreaDto deleteUsGrBusinessArea) {
		return ContextHolder.getBean(UsGrBusinessAreaDao.class).deleteByIds(deleteUsGrBusinessArea);
	}

	@Override
	public <P> P findByCodeOrId(final Class<P> mappedClass, final UsGrBusinessAreaDto findUsGrBusinessArea) {
		return ContextHolder.getBean(UsGrBusinessAreaDao.class).findByCodeOrId(mappedClass, findUsGrBusinessArea);
	}

	@Override
	public <P> P findById(final Class<P> mappedClass, final UsGrBusinessAreaDto findUsGrBusinessArea) {
		return ContextHolder.getBean(UsGrBusinessAreaDao.class).findById(mappedClass, findUsGrBusinessArea);
	}

	@Override
	public <P> List<P> findListByLikeCode(final Class<P> mappedClass, final UsGrBusinessAreaDto findListUsGrBusinessArea) {
		return ContextHolder.getBean(UsGrBusinessAreaDao.class).findListByLikeCode(mappedClass, findListUsGrBusinessArea);
	}

	@Override
	public int insertByCode(final UsGrBusinessAreaDto insertUsGrBusinessArea) {
		return ContextHolder.getBean(UsGrBusinessAreaDao.class).insertByCode(insertUsGrBusinessArea);
	}

	@Override
	public <P> PaginationDto<P> paginationByLikeCode(final Class<P> mappedClass, final UsGrBusinessAreaDto paginationUsGrBusinessArea) {
		return ContextHolder.getBean(UsGrBusinessAreaDao.class).paginationByLikeCode(mappedClass, paginationUsGrBusinessArea);
	}

	@Override
	public Integer readByCodeNqIdForCount(final UsGrBusinessAreaDto readUsGrBusinessArea) {
		return ContextHolder.getBean(UsGrBusinessAreaDao.class).readByCodeNqIdForCount(readUsGrBusinessArea);
	}

	@Override
	public <P> P saveByIdOrCode(final Class<P> mappedClass, final UsGrBusinessAreaDto saveUsGrBusinessArea) {
		return ContextHolder.getBean(UsGrBusinessAreaDao.class).saveByIdOrCode(mappedClass, saveUsGrBusinessArea);
	}

	@Override
	public int updateByCode(final UsGrBusinessAreaDto updateUsGrBusinessArea) {
		return ContextHolder.getBean(UsGrBusinessAreaDao.class).updateByCode(updateUsGrBusinessArea);
	}
}